package org.learn.test;

public class RecursionExercise02 {
    public static void main(String[] args) {
    B b = new B();
    int result = b.peach(1);
    System.out.println("第一天的桃子数量=" + result);
    }
}
class B{
    public int peach(int day){
        if(day == 10){
            return 1;
        }else if(day >= 1 & day <=9){
            return (peach(day+1)+1) *2;
        }else{
            System.out.println("day在第1-9天");
            return -1;
        }
    }
}